gtk4.git
4 years agoMerge branch 'wip/cdavis/flowbox-add-functions' into 'master'
Emmanuele Bassi [Mon, 18 Oct 2021 21:09:10 +0000 (21:09 +0000)]
Merge branch 'wip/cdavis/flowbox-add-functions' into 'master'

gtkflowbox: Add prepend() and append()

Closes #4277

See merge request GNOME/gtk!4013

4 years agoMerge branch 'wip/baedert/for-master' into 'master'
Matthias Clasen [Mon, 18 Oct 2021 20:58:46 +0000 (20:58 +0000)]
Merge branch 'wip/baedert/for-master' into 'master'

Some fixes, hmm yes

See merge request GNOME/gtk!4068

4 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Mon, 18 Oct 2021 18:00:33 +0000 (18:00 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Small fixes

Closes #4248

See merge request GNOME/gtk!4072

4 years agoMerge branch 'feature/calendar-first-day' into 'master'
Matthias Clasen [Mon, 18 Oct 2021 15:08:35 +0000 (15:08 +0000)]
Merge branch 'feature/calendar-first-day' into 'master'

calendar: Fix abbreviated day names

Closes #4338

See merge request GNOME/gtk!4061

4 years agoci: Allow macos to fail
Matthias Clasen [Mon, 18 Oct 2021 15:00:27 +0000 (11:00 -0400)]
ci: Allow macos to fail

The macos runner is out of commission atm

4 years agoMerge branch 'work/reset_opaque' into 'master'
Jonas Ådahl [Mon, 18 Oct 2021 13:45:32 +0000 (13:45 +0000)]
Merge branch 'work/reset_opaque' into 'master'

wayland: Mark opaque_region as dirty on hide

See merge request GNOME/gtk!4020

4 years agoMerge branch 'work/tidy' into 'master'
Jonas Ådahl [Mon, 18 Oct 2021 13:44:52 +0000 (13:44 +0000)]
Merge branch 'work/tidy' into 'master'

wayland: miscellaneous minor tidy ups

See merge request GNOME/gtk!4066

4 years agoMerge branch 'wip/otte/for-master' into 'master'
Benjamin Otte [Mon, 18 Oct 2021 13:32:02 +0000 (13:32 +0000)]
Merge branch 'wip/otte/for-master' into 'master'

glcontext: reinstate another missing "!"

See merge request GNOME/gtk!4070

4 years agoImprove a msgid
Matthias Clasen [Mon, 18 Oct 2021 12:23:27 +0000 (08:23 -0400)]
Improve a msgid

Instead of gl-context, say "GL Context".

Fixes: #4248
4 years agodocs: Cosmetics
Matthias Clasen [Sun, 17 Oct 2021 20:05:35 +0000 (22:05 +0200)]
docs: Cosmetics

Do a round of "the the" removal.

4 years agodocs: Cosmetics
Matthias Clasen [Sun, 17 Oct 2021 19:54:59 +0000 (21:54 +0200)]
docs: Cosmetics

4 years agotestsuite: Add workarounds for non-gl backends
Benjamin Otte [Mon, 18 Oct 2021 11:38:35 +0000 (13:38 +0200)]
testsuite: Add workarounds for non-gl backends

read: Fix tests for broadway

4 years agobroadway: Use gdk_texture_save_to_png_bytes()
Benjamin Otte [Sat, 25 Sep 2021 22:32:27 +0000 (00:32 +0200)]
broadway: Use gdk_texture_save_to_png_bytes()

Instead of using Cairo, save the texture directly.

4 years agogdk: Rework gdk_pixbuf_get_from_texture()
Benjamin Otte [Sat, 25 Sep 2021 22:22:20 +0000 (00:22 +0200)]
gdk: Rework gdk_pixbuf_get_from_texture()

Make it use gdk_memory_texture_from_texture().

Also make gdk_memory_format_alpha() privately available so that we can
detect if an image contains an alpha channel.

4 years agojpeg: Use gdk_memory_texture_from_texture()
Benjamin Otte [Sun, 17 Oct 2021 20:15:53 +0000 (22:15 +0200)]
jpeg: Use gdk_memory_texture_from_texture()

4 years agotiff: Refactor
Benjamin Otte [Sun, 17 Oct 2021 12:27:03 +0000 (14:27 +0200)]
tiff: Refactor

Now we support all the formats.

4 years agogltexture: Fix conditions for glGetTexImage() call
Benjamin Otte [Sun, 17 Oct 2021 04:54:38 +0000 (06:54 +0200)]
gltexture: Fix conditions for glGetTexImage() call

The conditions were inverted, plus we failed to limit this call to
non-GLES.

4 years agoglcontext: reinstate another missing "!"
Benjamin Otte [Sun, 17 Oct 2021 16:46:01 +0000 (18:46 +0200)]
glcontext: reinstate another missing "!"

A leftover from aa0c22b64813a406da9854fd079579d87181a97b.

4 years agoEnsure blur nodes have a positive blur radius
Timm Bäder [Sun, 17 Oct 2021 10:15:34 +0000 (12:15 +0200)]
Ensure blur nodes have a positive blur radius

4 years agomain: Flip set_widget_active_state() logic
Timm Bäder [Sun, 17 Oct 2021 09:21:00 +0000 (11:21 +0200)]
main: Flip set_widget_active_state() logic

The function used to take a boolean, just to set the active state of the
widget to the exact opposite of that boolean. Fix that.

4 years agotheme: enable tabular numbers in GtkCalendar
Timm Bäder [Sat, 16 Oct 2021 13:56:46 +0000 (15:56 +0200)]
theme: enable tabular numbers in GtkCalendar

It aligns numbers a lot so this makes sense.

4 years agofontrendering: Protect against NULL hints
Timm Bäder [Sat, 16 Oct 2021 13:44:58 +0000 (15:44 +0200)]
fontrendering: Protect against NULL hints

4 years agocssparser: Make a signed expression unsigned
Timm Bäder [Sat, 16 Oct 2021 06:51:32 +0000 (08:51 +0200)]
cssparser: Make a signed expression unsigned

4 years agoMerge branch 'fix-dnd-coordinates-on-windows' into 'master'
Benjamin Otte [Sat, 16 Oct 2021 17:04:26 +0000 (17:04 +0000)]
Merge branch 'fix-dnd-coordinates-on-windows' into 'master'

Fix DND coordinates on Windows

See merge request GNOME/gtk!3930

4 years agoMerge branch 'wip/otte/for-master' into 'master'
Benjamin Otte [Sat, 16 Oct 2021 14:11:00 +0000 (14:11 +0000)]
Merge branch 'wip/otte/for-master' into 'master'

glcontext: Reinstate missing "!"

Closes #4349

See merge request GNOME/gtk!4067

4 years agogdk: Move GdkMemoryFormat enum to gdktypes.h
Benjamin Otte [Sat, 16 Oct 2021 11:35:50 +0000 (13:35 +0200)]
gdk: Move GdkMemoryFormat enum to gdktypes.h

It's used in too many places now.

4 years agoglcontext: Reinstate missing "!"
Benjamin Otte [Sat, 16 Oct 2021 13:47:05 +0000 (15:47 +0200)]
glcontext: Reinstate missing "!"

Replacing the return_if_fail()s in commit f584d4f50025 lost the
inversions.

Fixes #4349

4 years agowayland: port code to g_clear_pointer
David Edmundson [Fri, 1 Oct 2021 12:31:39 +0000 (13:31 +0100)]
wayland: port code to g_clear_pointer

4 years agowayland: drop unused member variables
David Edmundson [Fri, 1 Oct 2021 12:24:50 +0000 (13:24 +0100)]
wayland: drop unused member variables

4 years agoMerge branch 'wip/otte/memoryformat' into 'master'
Benjamin Otte [Wed, 13 Oct 2021 12:51:37 +0000 (12:51 +0000)]
Merge branch 'wip/otte/memoryformat' into 'master'

Refactor various texture machinery

See merge request GNOME/gtk!4057

4 years agogl: Use gdk_memory_texture_new_from_texture()
Benjamin Otte [Tue, 12 Oct 2021 22:30:09 +0000 (00:30 +0200)]
gl: Use gdk_memory_texture_new_from_texture()

Way less code to prepare the texture in a proper format.

4 years agogl: Refactor texture uploading
Benjamin Otte [Tue, 12 Oct 2021 22:07:08 +0000 (00:07 +0200)]
gl: Refactor texture uploading

Don't pass texture + rect, but instead have
  gdk_memory_texture_new_subtexture()
and use it to generate subtextures and pass them.

This has the advantage of downloading the a too large texture only once
instead of N times.

4 years agogltexture: Determine format in current thread
Benjamin Otte [Tue, 12 Oct 2021 22:36:38 +0000 (00:36 +0200)]
gltexture: Determine format in current thread

Close widget-factory and observe:

Thread 1:
 * acquire main loop
 * handle close button
 * close window
 * dispose video and media stream
 * stop GstPlayer
WAIT on pipeline stopping

Thread 2:
 * prepare next image in pipeline
 * hand image to GtkGstSink
 * create GdkTexture from image
 * gdk_gl_texture_new() determines format
WAIT on acquiring main loop

Sounds like a deadlock?

Indeed, so don't do that.

4 years agogl: Move texture uploading to the renderer
Benjamin Otte [Tue, 12 Oct 2021 13:04:43 +0000 (15:04 +0200)]
gl: Move texture uploading to the renderer

It does not belong in GdkGLContext, it's a renderer thing.
It's also the only user of that API.

Introduce gdk_gl_context_check_version() private API to make version
checks simpler.

4 years agogl: Fix downloading textures *again*
Benjamin Otte [Mon, 11 Oct 2021 01:29:11 +0000 (03:29 +0200)]
gl: Fix downloading textures *again*

It turns out glReadPixels() cannot convert pixels and you are only
allowed to pass a single value into the function arguments. You need to
know which ones or things will explode.

GL is great.

4 years agopng: Refactor png saving
Benjamin Otte [Mon, 27 Sep 2021 03:55:48 +0000 (05:55 +0200)]
png: Refactor png saving

Do all the memory format shenanigans in GTK now and support all the PNG
formats.

4 years agoAdd memory formats used by libpng
Benjamin Otte [Sun, 26 Sep 2021 14:47:34 +0000 (16:47 +0200)]
Add memory formats used by libpng

Add unpremultiplied high-depth formats. They are used in the real world,
so let's support them.

4 years agoUpdate Icelandic translation
Sveinn í Felli [Tue, 12 Oct 2021 22:48:01 +0000 (22:48 +0000)]
Update Icelandic translation

(cherry picked from commit 83b3c7d826bea8254357639da58ddd4568d85a30)

4 years agogtkflowbox: Add prepend() and append()
Christopher Davis [Thu, 30 Sep 2021 02:45:45 +0000 (19:45 -0700)]
gtkflowbox: Add prepend() and append()

These functions are common across container implementations,
but GtkFlowBox was missing them.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/4277

4 years agocalendar: Add an explanatory comment
Niels De Graef [Tue, 12 Oct 2021 17:37:13 +0000 (19:37 +0200)]
calendar: Add an explanatory comment

On the magic numbers used to get the abbreviated day names.

4 years agoUpdate Brazilian Portuguese translation
Rafael Fontenelle [Tue, 12 Oct 2021 17:33:41 +0000 (17:33 +0000)]
Update Brazilian Portuguese translation

(cherry picked from commit 4b9260608a3c20fd049f694e0c9bb587bd6e34bf)

4 years agocalendar: Fix abbreviated day names
Niels De Graef [Tue, 12 Oct 2021 17:29:26 +0000 (19:29 +0200)]
calendar: Fix abbreviated day names

... if the current locale has a different starting day than Sunday.

This needed 2 fixes:
* We need to take into account `calendar->week_start` when
  creating/adding the appropriate `day_name_labels` field
* we were only calculating `calendar->week_start` _after_ attaching the
  `day_name_labels`, so it was still set to 0 (the default value).

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/4338

4 years agoMerge branch 'bilelmoussaoui/gtk-snapshot' into 'master'
Emmanuele Bassi [Tue, 12 Oct 2021 11:09:13 +0000 (11:09 +0000)]
Merge branch 'bilelmoussaoui/gtk-snapshot' into 'master'

gtk: fix Snapshot.push_shadow annotation

See merge request GNOME/gtk!4060

4 years agogtk: fix Snapshot.push_shadow annotation
Bilal Elmoussaoui [Tue, 12 Oct 2021 09:00:03 +0000 (09:00 +0000)]
gtk: fix Snapshot.push_shadow annotation

4 years agopng: Do loader conversions in GDK
Benjamin Otte [Sun, 26 Sep 2021 04:44:56 +0000 (06:44 +0200)]
png: Do loader conversions in GDK

Not inside libpng.

We really want to do them in GL, but we don't have a premultiply step
yet.

4 years agotexture: Refactor downloading
Benjamin Otte [Thu, 7 Oct 2021 04:19:41 +0000 (06:19 +0200)]
texture: Refactor downloading

Pass a format do GdkTextureClass::download(). That way we can download
data in any format.

Also replace gdk_texture_download_texture() with
gdk_memory_texture_from_texture() which again takes a format.

The old functionality is still there for code that wants it: Just pass
gdk_texture_get_format (texture) as the format argument.

4 years agoMerge branch 'wip/otte/for-master' into 'master'
Benjamin Otte [Mon, 11 Oct 2021 18:36:20 +0000 (18:36 +0000)]
Merge branch 'wip/otte/for-master' into 'master'

x11: Don't try to move destroyed windows

See merge request GNOME/gtk!4054

4 years agox11: Don't try to move destroyed windows
Benjamin Otte [Mon, 11 Oct 2021 17:22:46 +0000 (19:22 +0200)]
x11: Don't try to move destroyed windows

Fixes BadWindow crashes when the resize happen right when tooltips or
other such transient popups were in the process of being destroyed.

4 years agowayland: Mark opaque_region as dirty on hide
David Edmundson [Fri, 1 Oct 2021 12:28:00 +0000 (13:28 +0100)]
wayland: Mark opaque_region as dirty on hide

Otherwise if we hide and show a window we recreate a new surface,
breaking the compositor's association, but potentially not resend this
data for the new surface.
This matches what we do for input_region.

4 years agoMerge branch 'ngl-is-the-new-gl' into 'master'
Matthias Clasen [Mon, 11 Oct 2021 06:43:41 +0000 (06:43 +0000)]
Merge branch 'ngl-is-the-new-gl' into 'master'

Rename ngl to gl

Closes #4318

See merge request GNOME/gtk!4037

4 years agoMerge branch 'docs-window-position' into 'master'
Matthias Clasen [Mon, 11 Oct 2021 06:36:23 +0000 (06:36 +0000)]
Merge branch 'docs-window-position' into 'master'

docs: Mention gtk_window_set_position() being gone

See merge request GNOME/gtk!4048

4 years agoMerge branch 'docs-urlmap' into 'master'
Emmanuele Bassi [Sun, 10 Oct 2021 23:01:39 +0000 (23:01 +0000)]
Merge branch 'docs-urlmap' into 'master'

docs: Add GdkPixbuf to the URL map

See merge request GNOME/gtk!4051

4 years ago[gtkimcontextquartz] Accommodate moving GdkSurface widget to private.
John Ralls [Sun, 10 Oct 2021 20:16:49 +0000 (13:16 -0700)]
[gtkimcontextquartz] Accommodate moving GdkSurface widget to private.

Fixes macOS build.

4 years agoMerge branch 'wip/otte/gles' into 'master'
Benjamin Otte [Sat, 9 Oct 2021 11:59:42 +0000 (11:59 +0000)]
Merge branch 'wip/otte/gles' into 'master'

Improve GLES

See merge request GNOME/gtk!4050

4 years agodocs: Add GdkPixbuf to the URL map
Emmanuele Bassi [Sat, 9 Oct 2021 09:55:24 +0000 (10:55 +0100)]
docs: Add GdkPixbuf to the URL map

Allow cross-linking to the GdkPixbuf reference.

4 years agotestsuite: Add run for GLES
Benjamin Otte [Fri, 8 Oct 2021 16:38:51 +0000 (18:38 +0200)]
testsuite: Add run for GLES

This is supposed to test the most fallback GL stuff, so we might want to
set even more env vars here.

Also enable the run for the Fedora builder in CI.

4 years agogl: Make sure to set a proper alignment
Benjamin Otte [Sat, 9 Oct 2021 03:25:05 +0000 (05:25 +0200)]
gl: Make sure to set a proper alignment

No matter which branch we take, the alignment setting is always the
same.

4 years agogl: Check the stride is a multiple of the bpp
Benjamin Otte [Sat, 9 Oct 2021 03:24:44 +0000 (05:24 +0200)]
gl: Check the stride is a multiple of the bpp

4 years agogl: Set stride properly in fallback
Benjamin Otte [Sat, 9 Oct 2021 02:36:20 +0000 (04:36 +0200)]
gl: Set stride properly in fallback

4 years agogl: Fix broken internal format
Benjamin Otte [Sat, 9 Oct 2021 02:35:27 +0000 (04:35 +0200)]
gl: Fix broken internal format

4 years agotestsuite: Add a test targeting GL upload code
Benjamin Otte [Fri, 8 Oct 2021 18:15:07 +0000 (20:15 +0200)]
testsuite: Add a test targeting GL upload code

Previously, all the tests used the icon upload path using
glTexSubImage2D().

This test uses the custom texture path using glTexImage2D().

4 years agongl: Use the right value
Benjamin Otte [Fri, 8 Oct 2021 16:47:49 +0000 (18:47 +0200)]
ngl: Use the right value

It's GL_RGBA, not GL_BGRA, or GLES will complain.

4 years agoUpdate Basque translation
Asier Sarasua Garmendia [Fri, 8 Oct 2021 17:44:18 +0000 (17:44 +0000)]
Update Basque translation

(cherry picked from commit 2492729238b90c3b1f28a8776899ea2b11c379a3)

4 years agoMerge branch 'wip/otte/glcontext' into 'master'
Benjamin Otte [Fri, 8 Oct 2021 15:57:08 +0000 (15:57 +0000)]
Merge branch 'wip/otte/glcontext' into 'master'

glcontext: Make GLES vs GL configuration clearer

Closes #4221

See merge request GNOME/gtk!4044

4 years agodocs: Mention gtk_window_set_position() being gone
Emmanuele Bassi [Fri, 8 Oct 2021 11:27:24 +0000 (12:27 +0100)]
docs: Mention gtk_window_set_position() being gone

People search for it in the migration guide much more than other
GdkSurface and GtkWindow methods.

4 years agoMerge branch 'wip/otte/for-master' into 'master'
Benjamin Otte [Fri, 8 Oct 2021 09:11:03 +0000 (09:11 +0000)]
Merge branch 'wip/otte/for-master' into 'master'

Fix GLES fallout from recent NGL updates

See merge request GNOME/gtk!4046

4 years agoglcontext: Add gdk_gl_context_get_api()
Benjamin Otte [Thu, 7 Oct 2021 21:03:45 +0000 (23:03 +0200)]
glcontext: Add gdk_gl_context_get_api()

This is mostly for inspector.

Not sure if we also want to deprecate gdk_gl_context_get_use_es() in
favor of this function.

4 years agongl: Fix glTexImage2D() usage on GLES
Benjamin Otte [Fri, 8 Oct 2021 01:29:45 +0000 (03:29 +0200)]
ngl: Fix glTexImage2D() usage on GLES

GLES is very adamant about the format and type matching the internal
format, even if the data is NULL.

4 years agogl: Check allowed APIs in realize()
Benjamin Otte [Thu, 7 Oct 2021 20:10:39 +0000 (22:10 +0200)]
gl: Check allowed APIs in realize()

Add gdk_gl_context_is_api_allowed() for backends and make them use it.

Finally, have them return the final API as the return value (or 0 on
error).

And then use that api instead of a use_es boolean flag.

Fixes #4221

4 years agoglcontext: Deprecate gdk_gl_context_set_use_es()
Benjamin Otte [Thu, 7 Oct 2021 16:13:36 +0000 (18:13 +0200)]
glcontext: Deprecate gdk_gl_context_set_use_es()

Make it call gdk_gl_context_set_allowed_apis().

Also port callers to use this function.

4 years agoglcontext: Add GdkGLContext::allowed-apis
Benjamin Otte [Thu, 7 Oct 2021 15:59:17 +0000 (17:59 +0200)]
glcontext: Add GdkGLContext::allowed-apis

This allows specifying the GL APIs in a more comprehensive way than
gdk_gl_context_set_use_es().

4 years agongl: Compute correct renderformat
Benjamin Otte [Fri, 8 Oct 2021 00:31:25 +0000 (02:31 +0200)]
ngl: Compute correct renderformat

We want to round up, not down.

4 years agongl: fbo 0 has no color attachment
Benjamin Otte [Fri, 8 Oct 2021 00:28:49 +0000 (02:28 +0200)]
ngl: fbo 0 has no color attachment

Query the backbuffer instead.

4 years agogsk: provide an ngl renderer
Matthias Clasen [Thu, 7 Oct 2021 20:46:29 +0000 (16:46 -0400)]
gsk: provide an ngl renderer

Provide a minimal renderer implementation that fails
in realize. This avoids reusing the same type, which
might give bindings trouble.

4 years agoMerge branch 'wip/otte/for-master' into 'master'
Benjamin Otte [Thu, 7 Oct 2021 19:11:28 +0000 (19:11 +0000)]
Merge branch 'wip/otte/for-master' into 'master'

css: Render the background-clip area, not the background-origin

Closes #4324

See merge request GNOME/gtk!4043

4 years agocss: Render the background-clip area, not the background-origin
Benjamin Otte [Thu, 7 Oct 2021 17:50:02 +0000 (19:50 +0200)]
css: Render the background-clip area, not the background-origin

Testcase included

Fixes #4324

4 years agoSkip gsk_ngl type funcs
Matthias Clasen [Thu, 7 Oct 2021 16:37:55 +0000 (12:37 -0400)]
Skip gsk_ngl type funcs

The only type we have with this prefix is the
deprecated duplicate of gsk_gl_renderer_get_type(),
and including it causes some tests to break.
So skip it.

4 years agoMaintain abi
Matthias Clasen [Thu, 7 Oct 2021 04:50:27 +0000 (00:50 -0400)]
Maintain abi

Keep gsk_ngl_renderer_new and gsk_ngl_renderer_get_type,
since they were part of the abi in 4.2, and in an
installed header.

Fixes: #4318
4 years agoRename ngl to gl
Matthias Clasen [Thu, 7 Oct 2021 03:15:25 +0000 (23:15 -0400)]
Rename ngl to gl

We have only one gl renderer now, and it is
a bit odd for it not be called gl.

4 years agoMerge branch 'wip/cdavis/menu-item-markup' into 'master'
Matthias Clasen [Thu, 7 Oct 2021 12:32:46 +0000 (12:32 +0000)]
Merge branch 'wip/cdavis/menu-item-markup' into 'master'

Add support for pango markup in menu items

Closes #4306

See merge request GNOME/gtk!4039

4 years agoAdd support for pango markup in menu items
Christopher Davis [Thu, 7 Oct 2021 09:32:31 +0000 (02:32 -0700)]
Add support for pango markup in menu items

Before https://gitlab.gnome.org/GNOME/gtk/-/commit/c4a2234a28456fda5034bbaa155a1f8f76a6bebc
menu models could use markup for items and the markup would
be parsed, but this was not intended behavior.

This commit adds official support for using markup
for menu items via the `use-markup` property.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/4306

4 years agoMerge branch 'fix-filechooser-portal-crash' into 'master'
Matthias Clasen [Thu, 7 Oct 2021 05:05:49 +0000 (05:05 +0000)]
Merge branch 'fix-filechooser-portal-crash' into 'master'

filechooserportal: Take a ref on transient-for

Closes #4314

See merge request GNOME/gtk!4038

4 years agofilechooserportal: Take a ref on transient-for
Matthias Clasen [Thu, 7 Oct 2021 02:37:45 +0000 (22:37 -0400)]
filechooserportal: Take a ref on transient-for

This may fix a crash that has been reported in
file_chooser_portal_data_free.

Fixes: #4314
4 years agoMerge branch 'wip/matthiasc/gsk-hdr' into 'master'
Matthias Clasen [Thu, 7 Oct 2021 02:03:48 +0000 (02:03 +0000)]
Merge branch 'wip/matthiasc/gsk-hdr' into 'master'

texture: Add hdr api

See merge request GNOME/gtk!4036

4 years agongl: Make render_texture high depth aware
Matthias Clasen [Wed, 6 Oct 2021 22:31:09 +0000 (18:31 -0400)]
ngl: Make render_texture high depth aware

Make a deep texture, if the render nodes have
high depth content.

For now, we use 32F here for the deep format,
since using 16F causes small rounding errors
that break the memorytexture roundtrip tests.

4 years agongl: Update framebuffer format for each frame
Matthias Clasen [Fri, 1 Oct 2021 20:47:55 +0000 (16:47 -0400)]
ngl: Update framebuffer format for each frame

Look at whether the render nodes are high depth and
if so, request a high depth framebuffer.
Whether we actually get one is up to the backend.

4 years agongl: Determine intermediate formats
Matthias Clasen [Fri, 1 Oct 2021 12:48:43 +0000 (08:48 -0400)]
ngl: Determine intermediate formats

Look at the framebuffer and the rendernode to
determine what format to use for intermediate
textures.

Our preference here is to use fp16, if we have it
and it makes sense for the framebuffer we're given.

4 years agongl: Allow specifying texture formats
Matthias Clasen [Wed, 6 Oct 2021 03:36:49 +0000 (23:36 -0400)]
ngl: Allow specifying texture formats

Allow passing a format when creating textures or render targets.

Update all callers to pass GL_RGBA8, which is the format we
have always used so far.

4 years agogsk: Add high depth rendernode api
Matthias Clasen [Fri, 1 Oct 2021 20:23:12 +0000 (16:23 -0400)]
gsk: Add high depth rendernode api

Add private api to find out if the content
of a render node should be considered 'deep'.

The information is collected at creation time,
so there is no tree-walking involved when we
are using this information in the renderer.

Currently, this comes down to whether there are
any texture nodes with high depth textures in the subtree.
In the future, we may want to allow marking gradient
nodes in this way as well.

4 years agotexture: Make format a property of GdkTexture
Benjamin Otte [Thu, 7 Oct 2021 00:41:30 +0000 (02:41 +0200)]
texture: Make format a property of GdkTexture

For MemoryTexture, this is a simple change.

For GLTexture, we need to query the format at texture creation. This
sounds like a bad idea and extra work until one realizes that we'd
need to do that anyway when using the texure the first time - either
when downloading, or when trying to use it in a rendernode, where we
will soon need that information to determine if the texture prefers high
depth.

4 years agotestsuite: Fail more accurately
Benjamin Otte [Wed, 6 Oct 2021 20:17:33 +0000 (22:17 +0200)]
testsuite: Fail more accurately

Don't run the full test and then return "something failed" - instead
just explode when you find the failure.

4 years agocairo: Use GdkTexture for converting from pixbuf
Benjamin Otte [Wed, 6 Oct 2021 20:17:11 +0000 (22:17 +0200)]
cairo: Use GdkTexture for converting from pixbuf

4 years agogdk: hdr => high depth
Benjamin Otte [Wed, 6 Oct 2021 16:25:30 +0000 (18:25 +0200)]
gdk: hdr => high depth

The term "hdr" is so overloaded, we shouldn't use them anywhere, except
from maybe describing all of this work in blog posts and other marketing
materials.

So do renames:
* hdr => high_depth
* request_hdr => prefers_high_depth

This more accurately describes what is going on.

4 years agomemoryformat: Add gdk_memory_format_prefers_high_depth()
Benjamin Otte [Wed, 6 Oct 2021 15:55:14 +0000 (17:55 +0200)]
memoryformat: Add gdk_memory_format_prefers_high_depth()

This is unused so far, but is part of preparations for high depth
support in renderers.

4 years agogl: Move memory <=> GL format mapping
Benjamin Otte [Sat, 25 Sep 2021 02:47:45 +0000 (04:47 +0200)]
gl: Move memory <=> GL format mapping

Put it into gdkmemoryformat.c, where all the mapping goes.

4 years agomemorytexture: Split out GdkMemoryFormat handling
Benjamin Otte [Wed, 22 Sep 2021 00:01:41 +0000 (02:01 +0200)]
memorytexture: Split out GdkMemoryFormat handling

Also, now make gdk_memory_convert() the only conversion functions
and allow conversions between any 2 formats by going via a float[4].

This could be optimized via fast-paths, but so far it isn't.

4 years agoMerge branch 'wip/chergert/dropdown-show-arrow' into 'master'
Matthias Clasen [Wed, 6 Oct 2021 19:19:10 +0000 (19:19 +0000)]
Merge branch 'wip/chergert/dropdown-show-arrow' into 'master'

dropdown: add GtkDropDown:show-arrow property

See merge request GNOME/gtk!4033

4 years agodropdown: fix extraneous * in documentation
Christian Hergert [Wed, 6 Oct 2021 16:56:11 +0000 (09:56 -0700)]
dropdown: fix extraneous * in documentation

4 years agodropdown: add GtkDropDown:show-arrow property
Christian Hergert [Tue, 5 Oct 2021 21:27:14 +0000 (14:27 -0700)]
dropdown: add GtkDropDown:show-arrow property

This allows hiding the arrow on the dropdown which cannot otherwise be
controlled via CSS.

4 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Wed, 6 Oct 2021 03:50:04 +0000 (03:50 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

gdk: Fix an oversight

See merge request GNOME/gtk!4035